package com.xxzuibang.day9.this关键字;

public class TestPerson {
    public static void main(String[] args) {
        Person11 person11=new Person11("小小",19);
        Person11 person111=new Person11("大大",19);
        System.out.println(person11.CompareTo(person11));


    }
}

class Person11{
    String name;
    int age;

    public Person11(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Person11() {
    }

    public boolean CompareTo(Person11 person){
        if(this.name.equals(person.name)&&this.age== person.age){
           return true;
        }else{
          return false;
        }
    }

}